<template>
	<view class="orderConfirmView">
		<!-- <nav-bar isBack  title="确认订单" ></nav-bar> -->
		<nav-bars title="确认订单"></nav-bars>
		<!-- 顶部 -->
		<navigator class="address-container"
			:url="`/pages_mine/pages/my/address/list?isSelect=true&sourceFrom=${sourceFrom}&type=${buy_type}`">
			<view class="content" v-if="addressDatas.list.length>0">
				<view class="city">{{curAddress.province}} {{curAddress.city}} {{curAddress.area}}</view>
				<text>{{curAddress.address}}</text>
				<view class="name">
					<text>{{curAddress.name}} {{curAddress.mobile}}</text>
				</view>
			</view>
			<view class="content" v-if="addressDatas.list.length<1 && !addressDatas.loading">选择收货地址<text
					class="tag">新增</text></view>
			<text class="iconfont icon-more"></text>
		</navigator>
		<view class="c_cart">
			<view class="c_cGroup" v-for="items in skuList">
				<view class="c_cShop">
					<view class="c_csLogo">
						<image :src=" items.store_logo"></image>
					</view>
					<view class="c_csName">{{items.store_name}}</view>
				</view>
				<view class="c_cList">
					<view class="c_cItem" v-for="(item,index1) in items.medical_list" :key="index1"
						v-if="origin_type ==1">
						<view class="c_cImage" @click="toProduct(item.product_id)">
							<image :src="item.main_imgurl"></image>
						</view>
						<view class="c_cCont">
							<view class="c_cName omit-1" @click="toProduct(item.product_id)">{{item.product_title}}
							</view>
							<view class="c_cSize omit-1">
								<view class="c_csIcon"><text class="iconfont icon-more"></text></view>
								<text v-for="(item2,index) in item.attribute">{{item2.value}}</text>
							</view>
							<view class="c_cPrice">￥<text>{{item.price}}</text></view>
							<!-- <view class="c_cPrice2">￥<text>{{item.primary_price}}</text></view> -->
							<view class="c_cpay_nums">
								<view class="c_cnMinus" @tap="minusCart(items.store_id, item)" v-if="buy_type!=2"></view>
								<view class="c_cnpay_num">{{item.pay_num}}</view>
								<view class="c_cnAdd" @tap="addCart(items.store_id, item)" v-if="buy_type!=2"></view>
							</view>
						</view>
					</view>
					<view class="c_cItem" v-if="origin_type ==2">
						<view class="c_cImage" @click="toProduct(items.medical_list.product_id)">
							<image :src="items.medical_list.main_imgurl"></image>
						</view>
						<view class="c_cCont">
							<view class="c_cName omit-1" @click="toProduct(items.medical_list.product_id)">
								{{items.medical_list.product_title}}
							</view>
							<view class="c_cSize omit-1" v-if="items.medical_list.attribute">
								<view class="c_csIcon"><text class="iconfont icon-more"></text></view>
								<text v-for="(item2,index) in items.medical_list.attribute"
									:key="index">{{item2.value}}</text>
							</view>
							<view v-else style="height:44rpx"></view>
							<view class="c_cPrice" v-if="buy_type===2">
								￥<text>{{items.medical_list.activity_price}}</text></view>
							<view class="c_cPrice" v-else>￥<text>{{items.medical_list.price}}</text></view>
							<!-- <view class="c_cPrice2">￥<text>{{item.primary_price}}</text></view> -->
							<view class="c_cpay_nums">
								<view class="c_cnMinus" @tap="minusCart(items.store_id, items.medical_list)" v-if="buy_type!=2"></view>
								<view class="c_cnMinu" style="margin-top:5rpx;" v-if="buy_type==2">数量：</view>
								<view class="c_cnpay_num">{{items.medical_list.pay_num}}</view>
								<view class="c_cnAdd" @tap="addCart(items.store_id, items.medical_list)" v-if="buy_type!=2"></view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="cell-container">
			<view class="cell">
				<view class="left-text">商品金额</view>
				<div class="right-text">¥{{totalPrice ||'0.00'}}</div>
			</view>
			<view class="cell">
				<view class="left-text">运费</view>
				<div class="right-text tv1">¥0.00</div>
			</view>
			<view class="cell" v-if="isChanegPriceGoods != 1 && buy_type!=2">
				<view class="left-text">优惠</view>
				<div class="right-text tv1" @click="selectCiscount">-¥{{info.coupon_price || '0.00'}}<text
						style="color:#999;" class="iconfont icon-more"></text></div>
			</view>
			<view class="cell">
				<view class="left-text">发票</view>
				<div class="right-text">电子(商品明细-个人)<text style="color:#999;" class="iconfont icon-more"></text></div>
			</view>
			<view class="cell">
				<view class="left-text"></view>
				<div class="right-text tv1"><text style="font-size: 20rpx;color: #999;margin-right: 40rpx;">共计1件</text>
					小计：￥{{info.order_money||'0.00'}}</div>
			</view>
		</view>
		<view class="paycont">
			<view class="paytop">付款方式</view>
			<view class="paybox">
				<view class="left-box"><text class="weixin"></text>微信支付</view>
				<view class="right-box">
					<label class="radio">
						<radio style="transform:scale(0.85)" @click="radioChange(1)" :checked="tapIndex==1"
							color="#C3AB7C"></radio>
					</label>
				</view>
			</view>
			<view class="paybox">
				<view class="left-box"><text class="xianxia"></text>线下支付</view>
				<view class="right-box">
					<label class="radio">
						<radio style="transform:scale(0.85)" @click="radioChange(2)" :checked="tapIndex==2"
							color="#C3AB7C"></radio>
					</label>
				</view>
			</view>
		</view>
		<!-- <view class="pay-container">
			<view class="left-text">发票</view>
			<view class="right-text">
				<view>电子(商品明细-个人)<text class="iconfont icon-more"></text></view>
			</view>
			<i class="iconfont icon-right"></i>
		</view> -->
		<!-- <view class="note-container">
		    <view class="title">备注</view>
		    <textarea placeholder="请填写备注内容..." v-model="memo"></textarea>
		</view> -->
		<view class="footer-container">
			<view class="title" v-if="buy_type!=2">先付定金，确认收货后付尾款</view>
			<view class="paybtn">
				<view class="left-text" v-if="info.is_many_way == 1">
					<text>定金：</text>
					<text style="color: #C3AB7C;"> ¥ <text class="bold">{{info.deposit_money ||'0.00'}}</text></text>
				</view>
				<view class="left-text">
					<text>合计：￥{{info.order_money||'0.00'}}</text>
				</view>
				<view class="right-btn" @click.once="submitEvent">提交订单</view>
			</view>
		</view>
		<!-- 二维码 -->
		<view class="qrcodepop" :style="showModal?'':'display:none;'">
			<view class="qrcodecont">
				<view class="qrname">
					<view>核销二维码</view>
					<view><canvas canvas-id="myQrcode" style="height: 320rpx; width: 320rpx;"></canvas></view>
				</view>
				<view class="iconfont icon-close" @click="handleHideCodeClick"></view>
			</view>
		</view>
		<!-- 优惠券弹出 -->
		<u-popup v-model="showPop" mode="bottom" length="60%" border-radius="30" safe-area-inset-bottom closeable>
			<view class="couponBox">
				<view class="title">优惠详情</view>
				<view class="oneBox" v-if="couponList.cut && couponList.cut.length">
					<text>满减</text>
					<view class="list">
						<view class="item" :class="{'item_active':item.has_use!=1}"
							v-for="(item,index) in couponList.cut" :key="index" v-if="item.use_status==0">
							<view class="left">
								<view class="canPrice"><text>￥</text>{{item.discount_money}}</view>
								<view class="need">{{item.condition == 0?'无门槛':'满'+item.condition+'可用'}}</view>
							</view>
							<view class="right">
								<view class="time">
									有效时间
									<view class="term">
										{{$utils.getFormatDate(item.start_time*1000,'yyyy.MM.dd')}}-{{$utils.getFormatDate(item.end_time*1000,'yyyy.MM.dd')}}
									</view>
								</view>
								<view class="check" v-if="item.has_use==1" :class="{'active':item.checked}"
									@click="selectFn(index,item.id,'cut')">
									<view class="iconfont icon-selected"></view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="oneBox" v-if="couponList.beat && couponList.beat.length">
					<text>折扣</text>
					<view class="list">
						<view class="item" :class="{'item_active':item.has_use!=1}"
							v-for="(item,index) in couponList.beat" :key="index" v-if="item.use_status==0">
							<view class="left">
								{{item.discount_money*10}}折
							</view>
							<view class="right">
								<view class="time">
									有效时间
									<view class="term">
										{{$utils.getFormatDate(item.start_time*1000,'yyyy.MM.dd')}}-{{$utils.getFormatDate(item.end_time*1000,'yyyy.MM.dd')}}
									</view>
								</view>
								<view class="check" v-if="item.has_use==1" :class="{'active':item.checked}"
									@click="selectFn(index,item.id,'beat')">
									<view class="iconfont icon-selected"></view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import navBar from "@/components/navBar/navBar.vue"

	import service_mall from '@/service/mall.js'
	import service_enter from '@/service/address.js'
	import URL from '@/config/url.js'
	const qrCode = require('@/utils/weapp-qrcode.js')
	export default {
		components: {
			navBar
		},
		data() {
			return {
				suc: '',
				itemList: [],
				tapIndex: 1,
				sourceFrom: '',
				skuList: [],
				info: "",
				memo: "",
				terminal: "",
				totalPrice: '',
				Nocart: '',
				origin_type: '',
				addressDatas: {
					loading: false,
					fail: false,
					list: [],
					index: 0
				},
				code: '',
				showModal: false,
				order_codes: '',
				local_order_list: [],
				showPop: false,
				couponList: {},
				user_coupon_id: '',
				isChanegPriceGoods: null,
				buy_type: 0, //0 普通 1秒杀 2 团购
				team_id: '', //拼团类型团长id
			};
		},
		computed: {
			curAddress() {
				if (this.addressDatas.list.length > 0) {
					return this.addressDatas.list[this.addressDatas.index]
				} else {
					return undefined
				}
			},
			// couponPrice(){
			// 	let couponPrice = 0
			// 	if(this.couponList.cut && this.couponList.cut.length){
			// 		this.couponList.cut.map(item=>{
			// 			if(item.checked){
			// 				console.log(item,'优惠券cut')
			// 			}
			// 		})
			// 	}
			// 	if(this.couponList.beat && this.couponList.beat.length){
			// 		this.couponList.beat.map(item=>{
			// 			if(item.checked){
			// 				console.log(item,'优惠券beat')

			// 			}
			// 		})
			// 	}
			// }
		},
		onLoad(options) {
			this.$utils.getUrl()
			if (options.sourceFrom) {
				this.sourceFrom = options.sourceFrom;
			}
			if (options.Nocart) {
				this.Nocart = options.Nocart
			}
			this.buy_type = parseInt(options.buy_type);
			this.team_id = parseInt(options.team_id);
			const local_order_list = uni.getStorageSync('local_order_list');
			this.isChanegPriceGoods = local_order_list.goods.isModifyPrice
			this.local_order_list = local_order_list
			this.origin_type = local_order_list.origin_type
			if (local_order_list) {
				//#ifdef MP-WEIXIN
				this.terminal = "wxapplet";
				//#endif
				this.getUserAddressList(options);
				this.getUserorder(local_order_list);
				this.getCoupon()
			} else {
				uni.showModal('无订单信息');
			}
		},
		methods: {
			initQrCode: function() {
				new qrCode('myQrcode', {
					text: this.code,
					width: 150,
					height: 150,
					colorDark: "#333333",
					colorLight: "#FFFFFF",
					correctLevel: qrCode.CorrectLevel.H
				})
			},
			handleShowCodeClick: function() {
				this.showModal = true
				this.$nextTick(function() {
					this.initQrCode()
				})
			},
			handleHideCodeClick: function() {
				this.showModal = false
			},
			radioChange(t) {
				if (t == 1) {
					this.tapIndex = 1
				} else {
					this.tapIndex = 2
				}
			},
			// 选择优惠券
			selectCiscount() {
				this.showPop = true
			},
			// 获取优惠券
			getCoupon() {
				let params = {
					origin_type: this.local_order_list.origin_type,
					cart_ids: this.local_order_list.cart_ids,
					goods: this.local_order_list.goods
				}
				service_mall.getOrderCoupon(params).then(res => {
					console.log(res, '优惠券')
					if (res.code == 1) {
						res.data.cut.map(item => item.checked = false)
						res.data.beat.map(item => item.checked = false)
						this.couponList = res.data ? res.data : {}
					}
				})
			},
			// 选择
			selectFn(index, id, type) {
				console.log(index, type, '00000')
				// this.couponList.cut.map(item=>item.checked = false)
				// this.couponList.beat.map(item=>item.checked = false)
				if (type == 'cut') {
					this.couponList.beat.map(item => item.checked = false)
					if (this.couponList.cut[index].checked) {
						this.couponList.cut.map(item => item.checked = false)
						this.couponList.cut[index].checked = false
						this.user_coupon_id = ''
						this.getUserorder(this.local_order_list)
					} else {
						this.couponList.cut.map(item => item.checked = false)
						this.couponList.cut[index].checked = true
						this.user_coupon_id = id
						this.getUserorder(this.local_order_list)
					}
				} else {
					this.couponList.cut.map(item => item.checked = false)
					if (this.couponList.beat[index].checked) {
						this.couponList.beat.map(item => item.checked = false)
						this.couponList.beat[index].checked = false
						this.user_coupon_id = ''
						this.getUserorder(this.local_order_list)
					} else {
						this.couponList.beat.map(item => item.checked = false)
						this.couponList.beat[index].checked = true
						this.user_coupon_id = id
						this.getUserorder(this.local_order_list)
					}
				}
				
			},
			// 获取地址
			getUserAddressList(options) {
				service_enter.getlist({}).then(res => {
					this.addressDatas.loading = true;
					this.addressDatas.fail = false;
					if (res.code == 1) {
						this.addressDatas.loading = false;
						if (res.data.length > 0) {
							this.addressDatas.list = res.data;
							if (options.id) {
								this.addressDatas.index = res.data.findIndex(r => r.id == options.id)
							} else {
								if (res.data.findIndex(r => r.is_default == 1) != -1) {
									this.addressDatas.index = res.data.findIndex(r => r.is_default == 1)
								} else {
									this.addressDatas.index = 0
								}

							}
						}
					} else {
						uni.showToast(res.message);
						this.addressDatas.fail = true;
					}
				}).catch(err => {
					this.addressDatas.fail = true;
					this.addressDatas.loading = false;
				})
			},

			// 确认订单
			getUserorder(local_order_list) {
				let origin_type = local_order_list.origin_type
				let cart_ids = local_order_list.cart_ids
				let goods = local_order_list.goods
				let user_coupon_id = this.user_coupon_id
				let buy_type = this.buy_type
				console.log(user_coupon_id, '优惠券id')
				service_mall.getOrder({
					origin_type: origin_type,
					cart_ids: cart_ids,
					goods: goods,
					user_coupon_id: user_coupon_id,
					buy_type: buy_type
				}).then(res => {
					if (res.code == 1) {
						this.info = res.data
						this.skuList = res.data.product_lst
						this.countPrice() // 计算价格
						//this.getCoupon()
					}
				})
			},
			// 添加商品
			addCart(store_id, item) {
				if (this.origin_type == 1) {
					let cart = this.skuList
					let shop = cart.find(val => val.store_id == store_id)
					let goods = shop.medical_list.find(val => val.id == item.id)
					goods.pay_num++
					this.countPrice() // 计算价格
					if (this.Nocart != 1) {
						service_mall.goods_numSave({
							id: item.id,
							num: goods.pay_num
						}).then(res => {
							if (res.code == 1) {
								this.getUserorder(this.local_order_list)
								this.getCoupon()
							} else {
								goods.pay_num--
								uni.showToast({
									title: res.msg,
									icon: 'none',
									duration: 2000
								});
							}
						})

					} else {
						this.local_order_list.goods.num = goods.pay_num;
						this.getUserorder(this.local_order_list)
					}

				} else {
					let cart = this.skuList
					let shop = cart.find(val => val.store_id == store_id)
					let goods = shop.medical_list
					goods.pay_num++
					this.countPrice() // 计算价格
					if (this.Nocart != 1) {
						service_mall.goods_numSave({
							id: item.id,
							num: goods.pay_num
						})
						this.getUserorder(this.local_order_list)
					} else {
						this.local_order_list.goods.num = goods.pay_num
						this.getUserorder(this.local_order_list)
						this.getCoupon()
					}
				}

			},

			// 删减商品
			minusCart(store_id, item) {
				if (this.origin_type == 1) {
					let cart = this.skuList
					let shop = cart.find(val => val.store_id == store_id)
					let goods = shop.medical_list.find(val => val.product_id == item.product_id)
					if (goods.pay_num > 1) {
						goods.pay_num--
						this.countPrice() // 计算价格
						if (this.Nocart != 1) {
							service_mall.goods_numSave({
								id: item.id,
								num: goods.pay_num
							}).then(res => {
								if (res.code == 1) {
									this.getUserorder(this.local_order_list)
									this.getCoupon()
								} else {
									uni.showToast({
										title: res.msg,
										icon: 'none',
										duration: 2000
									});
								}
							})

						} else {
							this.local_order_list.goods.num = goods.pay_num
							this.getUserorder(this.local_order_list)
						}
					}
				} else {
					let cart = this.skuList
					let shop = cart.find(val => val.store_id == store_id)
					let goods = shop.medical_list
					if (goods.pay_num > 1) {
						goods.pay_num--
						this.countPrice() // 计算价格
						if (this.Nocart != 1) {
							service_mall.goods_numSave({
								id: item.id,
								num: goods.pay_num
							})
							this.getUserorder(this.local_order_list)
						} else {
							this.local_order_list.goods.num = goods.pay_num
							this.getUserorder(this.local_order_list)
							this.getCoupon()
						}
					}
				}

			},
			// 计算价格
			countPrice() {
				if (this.origin_type == 1) {
					let price = 0
					this.skuList.forEach(val => {
						val.medical_list.forEach(v => {
							price = this.$utils.accAdd(price, this.$utils.accMul(v.pay_num, v.price))
						})

					})
					this.totalPrice = price
				} else {
					let price = 0;
					let buy_type = this.buy_type;
					if (buy_type == 2) { //拼团类型
						this.skuList.forEach(val => {
							price = this.$utils.accAdd(price, this.$utils.accMul(val.medical_list.pay_num, val
								.medical_list.activity_price))
						})
					} else {
						this.skuList.forEach(val => {
							price = this.$utils.accAdd(price, this.$utils.accMul(val.medical_list.pay_num, val
								.medical_list.price))
						})
					}
					this.totalPrice = price
				}

			},
			async submitEvent() {
				const local_order_list = uni.getStorageSync('local_order_list');
				if (!this.curAddress) {
					uni.showToast({
						title: '请选择收货地址!',
						icon: 'none',
						duration: 2000
					});
					return
				}
				let origin_type = local_order_list.origin_type
				let cart_ids = local_order_list.cart_ids
				let share_id=local_order_list.share_id
				// let goods = local_order_list.goods
				let ary = {}
				this.skuList.forEach(val => {
					ary = {
						sku_id: val.medical_list.sku_id,
						pack_id: val.medical_list.pack_id,
						num: val.medical_list.pay_num,
						isModifyPrice: local_order_list.goods.isModifyPrice,
						modifyPriceUser: local_order_list.goods.modifyPriceUser,
					}
				})
				service_mall.getupOrder({
					origin_type: this.origin_type,
					cart_ids: cart_ids,
					goods: ary,
					address_id: this.curAddress.id,
					user_coupon_id: this.user_coupon_id,
					buy_type: this.buy_type,
					team_id: this.team_id,
					share_id:share_id,
				}).then(res => {
					if (res.code == 1) {
						let data = res.data
						this.order_codes = res.data.order_codes
						this.getpayorder(res.data.order_codes)

					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
					}
				})

			},
			getpayorder(order_codes) {
				service_mall.getpay({
					order_no: order_codes,
					type: 'product_order',
					pay_type: this.tapIndex
				}).then(res => {
					if (res.code == 1) {
						let data = res.data
						if (this.tapIndex == 1) {
							if (this.terminal == 'wxapplet') {
								uni.requestPayment({
									appId: res.data.appId,
									nonceStr: res.data.nonceStr,
									package: res.data.package,
									paySign: res.data.paySign,
									signType: res.data.signType,
									timeStamp: res.data.timeStamp,
									success: (suc) => {
										uni.navigateTo({
											url: "/pages_mall/pages/mall/order/sucess?type=1" +
												'&order_no=' + order_codes
										})
									},
									fail: (err) => {
										uni.navigateTo({
											url: "/pages_mall/pages/mall/order/sucess?type=0" +
												'&order_no=' + order_codes
										})
									}
								});
							} else {
								uni.requestPayment({
									provider: 'wxpay',
									orderInfo: {
										"appid": res.data.appid,
										"partnerid": res.data.partnerid,
										"prepayid": res.data.prepayid,
										"noncestr": res.data.noncestr,
										"package": res.data.package,
										"timestamp": res.data.timestamp,
										"sign": res.data.sign,
									},
									success: (suc) => {
										uni.navigateTo({
											url: "/pages_mall/pages/mall/order/sucess?type=1" +
												'&order_no=' + order_codes
										})
									},
									fail: (err) => {
										uni.navigateTo({
											url: "/pages_mall/pages/mall/order/sucess?type=0" +
												'&order_no=' + order_codes
										})
									}
								});
							}
						} else {
							this.code = res.data.verificationCode
							this.handleShowCodeClick()
						}

					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
					}
				})
			}

		}
	}
</script>

<style lang="scss">
	.orderConfirmView {
		min-height: 100%;
		background-color: #f6f6f6;
		padding-bottom: 150rpx;

		.couponBox {
			padding: 40rpx 30rpx 0;

			.title {
				text-align: center;
				font: 600 32rpx/52rpx PingFang SC;
				color: #333;
			}

			.oneBox {
				text {
					font: 400 24rpx/36rpx PingFang SC;
					color: #333;
				}

				.list {
					.item {
						margin: 28rpx 0;
						width: 687rpx;
						height: 144rpx;
						// padding: 0 22rpx;
						background-image: url(https://manager.ryz1620.com/static/my/couponBg.png);
						background-size: 100% 100%;
						display: flex;

						.left {
							flex-shrink: 0;
							display: flex;
							flex-direction: column;
							align-items: center;
							justify-content: center;
							width: 210rpx;
							font: 500 48rpx/66rpx PingFang SC;
							color: #E9423E;

							.need {
								font: 400 24rpx/36rpx PingFang SC;
							}

							.canPrice {
								display: flex;
								align-items: flex-end;

								text {
									font-size: 26rpx;
									line-height: 56rpx;
									font-weight: bold;
									color: #E9423E;
								}
							}
						}

						.right {
							width: 100%;
							display: flex;
							padding: 0 40rpx;
							justify-content: space-between;
							align-items: center;

							.time {
								font: 400 24rpx/36rpx PingFang SC;
								color: #333;

								.term {
									margin-top: 22rpx;
									font: 400 20rpx/40rpx PingFang SC;
								}
							}

							.check {
								width: 36rpx;
								height: 36rpx;
								border-radius: 50%;
								border: 2rpx solid #E9423E;
								background-color: #fff;
								text-align: center;
								line-height: 36rpx;

								.iconfont {
									font-size: 26rpx;
									color: #fff;
								}
							}

							.active {
								background-color: #E9423E;
							}
						}
					}

					.item_active {
						background-image: url(https://manager.ryz1620.com/static/my/couponNotBg.png);

						.left {
							color: #CCCCCC;

							.canPrice {
								text {
									color: #ccc;
								}
							}
						}

						.right {
							.time {
								color: #ccc;
							}
						}
					}
				}
			}
		}

		.tips-container {
			padding: 10rpx 20rpx;
			font-size: 22rpx;
			background-color: #faebd7;
			color: #fc9004;

			.iconfont {
				font-size: 35rpx;
			}
		}

		@mixin card {
			padding: 20rpx;
			position: relative;
			background-color: #fff;
		}

		.address-container {
			display: flex;
			align-items: center;
			font-size: 28rpx;
			justify-content: space-between;
			background-image: url(@/static/mall/line.png);
			background-size: 100% 6rpx;
			background-repeat: no-repeat;
			background-position: left bottom;
			@include card;

			.icon {
				width: 80rpx;
				height: 80rpx;
				flex-shrink: 0;
			}

			.content {
				min-width: 0;
				flex: 1;
				padding-left: 20rpx;

				.tag {
					background-color: red;
					color: #fff;
					font-size: 20rpx;
					padding: 4rpx 10rpx;
					margin-left: 10rpx;
				}

				.city {
					color: #999;
					padding-bottom: 14rpx;
				}

				.name {
					margin-top: 18rpx;
				}
			}
		}

		.goods-container {
			@include card;
			margin-bottom: 20rpx;

			.row-1 {
				display: flex;
				align-items: center;
				font-size: 28rpx;
				justify-content: space-between;

				.left-text {
					color: #fff;
					padding-bottom: 10rpx;
				}

				.right-text {
					padding-right: 20rpx;
				}
			}

			.row-item {
				padding: 10rpx 0;
				display: flex;
				align-items: center;

				image {
					flex-shrink: 0;
					height: 160rpx;
					width: 180rpx;
					border-radius: 8rpx;
					// background-color: #f6f6f6;
				}

				.box-right {
					padding-left: 20rpx;
					width: 100%;
					min-width: 200rpx;
				}

				.discounts {
					background-color: #fce5e5;
					color: red;
				}

				.discounts,
				.sku {
					padding: 4rpx 10rpx;
					font-size: 24rpx;
					margin-top: 10rpx;
					display: inline-block;
				}

				.sku {
					background-color: #eee;
					color: #999;
					margin-bottom: 10rpx;
				}

				.price {
					color: red;
					font-size: 34rpx;
				}

				.num-box {
					display: flex;
					align-items: center;
					justify-content: flex-end;

					.num {
						font-size: 26rpx;
						color: #999;
						bottom: 18rpx;
						right: 220rpx;
						margin-right: 15rpx;
					}

					.btn {
						width: 40rpx;
						height: 40rpx;
						display: flex;
						justify-content: center;
						align-items: center;
						font-size: 34rpx;
						border-radius: 50%;
						text-align: center;
						background-color: #fa8888;
						margin: 0 10rpx;
						color: #fff;
						border: 2rpx solid #eee;
					}

					input {
						width: 100rpx;
						text-align: center;
					}
				}

			}
		}

		.pay-container {
			@include card;
			margin-bottom: 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 28rpx;

			.left-text {
				color: #999;
			}

			.right-text {
				flex: 1;
				display: flex;
				justify-content: flex-end;
				align-items: center;

				image {
					width: 40rpx;
					height: 40rpx;
					margin-right: 10rpx;
					float: left;
				}
			}
		}

		.delivery-ontainer {
			@include card;
			margin-bottom: 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 28rpx;

			.left-text {
				color: #999;
			}

			.right-text {
				flex: 1;
				display: flex;
				flex-direction: column;
				align-items: flex-end;

				&>view:nth-child(2) {
					font-size: 26rpx;
				}

				&>view:nth-child(3) {
					font-size: 24rpx;
					color: #999;
				}

				.time {
					color: #f90;
				}
			}
		}

		.cell-container {
			@include card;
			margin-bottom: 20rpx;
			font-size: 28rpx;

			.cell {
				display: flex;
				padding: 15rpx 0;
				justify-content: space-between;
				margin-bottom: 10rpx;

				&:last-of-type {
					margin-bottom: 0;
				}

				.left-text {
					color: #999;
				}
			}
		}

		.note-container {
			@include card;
			font-size: 28rpx;

			.title {
				color: #999;
			}

			textarea {
				width: 100%;
				height: 150rpx;
				font-size: 28rpx;
				margin-top: 20rpx;
			}
		}

		.footer-container {
			width: 100%;
			min-height: 90rpx;
			position: fixed;
			bottom: 0;
			background-color: #fff;
			font-size: 28rpx;
			border-top: 2rpx solid #eee;
			padding: 20rpx;
			z-index: 2;

			.title {
				text-align: center;
				font-size: 24rpx;
				color: #A0A0A0;
				padding-bottom: 25rpx;
			}

			.paybtn {
				background: #1A1C20;
				height: 88rpx;
				line-height: 88rpx;
				border-radius: 10rpx;
				overflow: hidden;

				.left-text {
					padding-left: 20rpx;
					padding-right: 0;
					color: #fff;
					display: inline-block;
					font-size: 23rpx;

					.bold {
						font-weight: bold;
						font-size: 28rpx;
					}
				}

				.right-btn {
					float: right;
					padding: 0 40rpx;
					height: 100%;
					background-color: red;
					display: flex;
					align-items: center;
					justify-content: center;
					background: #C3AB7C;
					text-align: center;
					color: #fff;
					font-size: 28rpx;

				}
			}

		}
	}

	.c_cart {
		padding-bottom: 0rpx;
		overflow: hidden;

		.c_cGroup {
			margin-top: 16rpx;
			background: #fff;
		}

		.c_cShop {
			height: 100rpx;
			padding-left: 20rpx;
			position: relative;
			display: flex;
			align-items: center;

			&::after {
				content: "";
				width: 100%;
				height: 1px;
				background: rgba(0, 0, 0, .08);
				position: absolute;
				bottom: 0;
				left: 0;
				transform: scaleY(.5);
			}

			.c_csInto {
				width: 122rpx;
				height: 44rpx;
				line-height: 44rpx;
				text-align: center;
				color: #cbaf87;
				font-size: 22rpx;
				margin-top: -22rpx;
				border: 1px solid #e7dec8;
				border-radius: 22rpx;
				position: absolute;
				top: 50%;
				right: 32rpx;
			}

			.c_csLogo {
				width: 50rpx;
				height: 50rpx;
				margin-right: 16rpx;
				border-radius: 50%;
				background: #f6f7fb;
				overflow: hidden;
			}
		}

		.c_cItem {
			min-height: 252rpx;
			padding: 24rpx;
			position: relative;

			&::after {
				content: "";
				width: 100%;
				height: 1px;
				background: rgba(0, 0, 0, .08);
				position: absolute;
				bottom: 0;
				left: 38rpx;
				right: 0;
				transform: scaleY(.5);
			}

			&:last-child::after {
				content: none;
			}

			.c_cImage {
				width: 150rpx;
				height: 150rpx;
				margin-right: 16rpx;
				border-radius: 4rpx;
				background: #f6f7fb;
				float: left;
			}

			.c_cCont {
				overflow: hidden;
			}

			.c_cName {
				height: 40rpx;
				line-height: 40rpx;
				color: #1a1c20;
			}

			.c_cSize {
				max-width: 100%;
				height: 44rpx;
				line-height: 44rpx;
				color: #939393;
				font-size: 24rpx;
				padding: 0 38rpx 0 14rpx;
				margin-top: 12rpx;
				border-radius: 4rpx;
				background: #f9f6f3;
				position: relative;
				display: inline-block;

				.c_csIcon {
					width: 32rpx;
					height: 32rpx;
					line-height: 32rpx;
					text-align: center;
					font-size: 22rpx;
					margin-top: -19.5rpx;
					position: absolute;
					top: 50%;
					right: 8rpx;
					transform: rotate(90deg);
				}
			}

			.c_cPrice {
				height: 44rpx;
				line-height: 44rpx;
				color: #ef5854;
				font-size: 20rpx;
				font-weight: bold;
				margin-top: 12rpx;

				&>text {
					font-size: 32rpx;
				}
			}

			.c_cPrice2 {
				color: #999;
				font-size: 20rpx;
				margin-top: 12rpx;

				&>text {
					font-size: 28rpx;
					text-decoration: line-through;
				}
			}

			.c_cpay_nums {
				height: 48rpx;
				position: absolute;
				bottom: 24rpx;
				right: 6rpx;
				display: flex;
			}

			.c_cnpay_num {
				width: 72rpx;
				height: 48rpx;
				line-height: 48rpx;
				text-align: center;
				border-radius: 8rpx;
				background: #f6f7fb;
			}

			.c_cnMinus,
			.c_cnAdd {
				width: 72rpx;
				height: 48rpx;
				position: relative;
			}

			.c_cnMinus::before,
			.c_cnAdd::before,
			.c_cnAdd::after {
				content: "";
				width: 24rpx;
				height: 4rpx;
				border-radius: 4rpx;
				background: #333;
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -50%);
			}

			.c_cnAdd::after {
				width: 4rpx;
				height: 24rpx;
			}
		}

		.c_cSelect {
			width: 108rpx;
			height: 100%;
			position: absolute;
			top: 0;
			left: 0;
			display: flex;
			justify-content: center;
			align-items: center;

			&.active .c_csIcon {
				border: none;
				background: #cbaf87;

				&>image {
					display: block;
				}
			}

			.c_csIcon {
				width: 36rpx;
				height: 36rpx;
				border: 1px solid rgba(0, 0, 0, .2);
				border-radius: 50%;

				&>image {
					display: none;
				}
			}
		}
	}

	.orderConfirmView .footer-container {
		width: 100%;
		min-height: 110rpx;
		position: fixed;
		bottom: 0;
		background-color: #fff;
		font-size: 28rpx;
		border-top: 2rpx solid #eee;
		padding: 20rpx;
		z-index: 2;

		.title {
			text-align: center;
			font-size: 24rpx;
			color: #A0A0A0;
			padding-bottom: 25rpx;
		}

		.paybtn {
			width: 100%;
			background: #1A1C20;
			height: 88rpx;
			line-height: 88rpx;
			border-radius: 10rpx;
			overflow: hidden;

			.left-text {
				padding-left: 20rpx;
				padding-right: 0;
				display: inline-block;
				font-size: 24rpx;

				.bold {
					font-weight: bold;
					font-size: 28rpx;
				}
			}

			.right-btn {
				float: right;
				height: 100%;
				background-color: red;
				display: flex;
				align-items: center;
				justify-content: center;
				background: #C3AB7C;
				text-align: center;
				color: #fff;
				font-size: 28rpx;

			}
		}

	}

	.tv1 {
		color: #E9423E;
	}

	.paycont {
		background: #fff;
		padding: 10rpx 20rpx;
		padding-bottom: 80rpx;

		.paytop {
			font-size: 28rpx;
			color: #999;
			line-height: 60rpx;
		}

		.paybox {
			line-height: 100rpx;
			height: 100rpx;

			.left-box {
				display: inline-block;
				float: left;

				.weixin {
					display: block;
					float: left;
					margin-right: 15rpx;
					width: 60rpx;
					height: 60rpx;
					margin-top: 20rpx;
					background: url(@/static/my/weixin.png) no-repeat center center #8BC37A;
					background-size: 40rpx;
					border-radius: 8rpx;
				}

				.xianxia {
					display: block;
					float: left;
					margin-right: 15rpx;
					width: 60rpx;
					height: 60rpx;
					margin-top: 20rpx;
					background: url(@/static/my/xianxia.png) no-repeat center center #C3AB7C;
					background-size: 40rpx;
					border-radius: 8rpx;
				}
			}

			.right-box {
				float: right;
			}
		}
	}

	.qrcodepop {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.2);
		z-index: 9999;

		.qrcodecont {
			width: 400rpx;
			position: absolute;
			left: 50%;
			top: 25%;
			margin-left: -200rpx;

			.qrname {
				background: #fff;
				line-height: 80rpx;
				height: 440rpx;
				overflow: hidden;
				padding: 20rpx;
				text-align: center;
				border-radius: 15rpx;

				canvas {
					width: 320rpx;
					height: 320rpx;
					margin: auto;
				}
			}

			.icon-close {
				display: block;
				font-size: 60rpx;
				color: #fff;
				text-align: center;
				margin: 30rpx auto;
			}
		}
	}
</style>
